<?php
namespace common\util;

use think\Request;

class UrlUtil {
    
    /**
     * 获取当前url
     */
    public static function getCurUrl() {
        if (isset($_SERVER['ORIGIN_URL'])) {
            return $_SERVER['ORIGIN_URL'];
        }else{
            return Request::instance()->domain().Request::instance()->url();
        }
        return '';
    }
    
    public static function getHost(){
        return Request::instance()->domain();
    }
}
